/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;

/**
 * <p>Project: app2022 - File2
 * <p>Powered by webrx On 2022-01-17 16:37:28
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class File2 {
    public static void main(String[] args) throws FileNotFoundException {
        var f = new File("u.txt");
        System.out.println(f.isFile());//true
        System.out.println(f.exists());//true
        System.out.println(f.isHidden());//true
        System.out.println(f.length());//文件大小 25byte 字节
        System.out.println(f.isDirectory());//false
        System.out.println(f.getName());//u.txt
        System.out.println(f.getAbsolutePath());//C:\\app2022\\u.txt
        System.out.println(f.getPath());//u.txt
        System.out.println(f.getParent());//null
        System.out.printf("%tF %<tT", f.lastModified());

        String cf = "C:\\app2022\\08io\\src\\main\\java\\cn\\webrx\\File2.java";
        var br = new BufferedReader(new FileReader(cf));
        System.out.println();
        System.out.println(br.lines().count());
    }
}
